import { handleSearchLoading, handleSearchTime } from "@userList/search";
import { searchList } from "./store";
import { refreshTable } from ".";
const searchLoading = ref(false);
const resetLoading = ref(false);
export const searchConfig = () => {
  const defineSearch = {
    okText: getProxyT("base.query"),
    cancelText: getProxyT("base.reset"),
    searchLoading,
    resetLoading,
    refreshTableData: async (searchParams: any, type: number) => {
      handleSearchTime(
        ["payment_time_start", "payment_time_end"],
        searchParams
      );
      handleSearchLoading(true, type, defineSearch);
      await refreshTable(searchParams);
      handleSearchLoading(false, type, defineSearch);
    },
    searchList,
  };
  return defineSearch;
};
